#pragma once

#include <Windows.h>

class CriticalSection{
public:
	CriticalSection(void);
	~CriticalSection(void);
public:
	LPCRITICAL_SECTION Get(){ return &_cs; }
protected:
	CRITICAL_SECTION _cs;
};

template<typename T>
class CSLocker{
public:
	CSLocker():{ ::EnterCriticalSection(_cs.Get()); }
	~CSLocker(){ ::LeaveCriticalSection(_cs.Get()); }
protected:
	CSLocker(CSLocker&);
	CSLocker(CriticalSection&);
protected:
	CriticalSection _cs;
};
